From b7fe460763d3af03fdde9e369375a7e2a133def4 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 17 Oct 2006 18:28:27 +0100 Subject: [PATCH] [SOLARIS] The hotplug scripts live in a different place on Solaris. Signed-off-by: John Levon --- tools/python/xen/util/auxbin.py | 2 +- tools/python/xen/xend/XendRoot.py | 5 +++-- tools/python/xen/xend/osdep.py | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tools/python/xen/xend/osdep.py diff --git a/tools/python/xen/util/auxbin.py b/tools/python/xen/util/auxbin.py index 50450773dd..5d2066157c 100644 --- a/tools/python/xen/util/auxbin.py +++ b/tools/python/xen/util/auxbin.py @@ -21,7 +21,7 @@ LIB_64 = "/usr/lib64" LIB_BIN_SUFFIX = "xen/bin" ## The architectures on which the LIB_64 directory is used. This -# deliberately excludes ia64 and ppc64. +# deliberately excludes ia64 and ppc64, and Solaris. LIB_64_ARCHS = [ 'x86_64', 's390x', 'sparc64'] diff --git a/tools/python/xen/xend/XendRoot.py b/tools/python/xen/xend/XendRoot.py index 4b81705b24..075dfe43bc 100644 --- a/tools/python/xen/xend/XendRoot.py +++ b/tools/python/xen/xend/XendRoot.py @@ -30,6 +30,7 @@ import os.path import string import sys +import osdep import XendLogging from XendError import XendError @@ -46,10 +47,10 @@ class XendRoot: config_var = "XEND_CONFIG" """Where network control scripts live.""" - network_script_dir = "/etc/xen/scripts" + network_script_dir = osdep.scripts_dir """Where block control scripts live.""" - block_script_dir = "/etc/xen/scripts" + block_script_dir = osdep.scripts_dir """Default path to the log file. """ logfile_default = "/var/log/xen/xend.log" diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py new file mode 100644 index 0000000000..296dac4369 --- /dev/null +++ b/tools/python/xen/xend/osdep.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of version 2.1 of the GNU Lesser General Public +# License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. + +import os + +_scripts_dir = { + "Linux": "/etc/xen/scripts", + "SunOS": "/usr/lib/xen/scripts", +} + +scripts_dir = _scripts_dir.get(os.uname()[0], "/etc/xen/scripts") -- 2.30.2